Bug 553086 – hard to see current immodule
authorMatthias Clasen <mclasen@redhat.com>
Tue, 30 Sep 2008 00:58:39 +0000 (00:58 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 30 Sep 2008 00:58:39 +0000 (00:58 +0000)
2008-09-29  Matthias Clasen  <mclasen@redhat.com>

        Bug 553086 – hard to see current immodule

        * gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):
        Display the actually selected context in the system menuitem.
        Complaint by Akira Tagoh.

svn path=/trunk/; revision=21548

ChangeLog
gtk/gtkimmulticontext.c

index 86caab9a75c74096015d040d737440146b1a1420..e24712f0bb5e191c784974d70e541b4314d5163c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-29  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 553086 – hard to see current immodule
+
+       * gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):
+       Display the actually selected context in the system menuitem.
+       Complaint by Akira Tagoh.
+
 2008-09-29  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 530568 – Entries with visibility=FALSE should warn for caps-lock
index 70820a942a2cebd27e31348edc8108d65ea342b4..8ce3aa988d1fee18813d18a974e5145635fa5921 100644 (file)
@@ -538,9 +538,11 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context,
   const GtkIMContextInfo **contexts;
   guint n_contexts, i;
   GSList *group = NULL;
-  GtkWidget *menuitem;
+  GtkWidget *menuitem, *system_menuitem;
+  const char *system_context_id; 
   
-  menuitem = gtk_radio_menu_item_new_with_label (group, Q_("input method menu|System"));
+  system_context_id = _gtk_im_module_get_default_context_id (context->priv->client_window);
+  system_menuitem = menuitem = gtk_radio_menu_item_new_with_label (group, Q_("input method menu|System"));
   if (!user_context_id)
     gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
   group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
@@ -550,6 +552,10 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context,
   gtk_widget_show (menuitem);
   gtk_menu_shell_append (menushell, menuitem);
 
+  menuitem = gtk_separator_menu_item_new ();
+  gtk_widget_show (menuitem);
+  gtk_menu_shell_append (menushell, menuitem);
+
   _gtk_im_module_list (&contexts, &n_contexts);
 
   for (i = 0; i < n_contexts; i++)
@@ -613,7 +619,18 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context,
       if ((user_context_id &&
            strcmp (contexts[i]->context_id, user_context_id) == 0))
         gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
-      
+
+      if (strcmp (contexts[i]->context_id, system_context_id) == 0)
+        {
+          GtkWidget *label;
+          char *text;
+
+          label = gtk_bin_get_child (GTK_BIN (system_menuitem));
+          text = g_strdup_printf (Q_("input method menu|System (%s)"), translated_name);
+          gtk_label_set_text (GTK_LABEL (label), text);
+          g_free (text);
+        }     
       group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
       
       g_object_set_data (G_OBJECT (menuitem), I_("gtk-context-id"),